import request from '@/utils/request-product'


//1.获取品牌列表接口
//GET /admin/product/baseTrademark/{page}/{limit}
export const reqtradeMarkList=(page,limit)=>{
    return request({url:`/admin/product/baseTrademark/${page}/${limit}`,method:'get'})
}


//2.新增和修改品牌接口
//POST /admin/product/baseTrademark/save  名字/logo
//PUT /admin/product/baseTrademark/update  id/名字/logo
//新增品牌不用带id因为id是服务器生成的，修改品牌需要因为需要用id来确认是哪个商品
export const reqAddandUpdataTradeMark=(trademark)=>{
    //修改品牌
    if(trademark.id)
    return request({url:'/admin/product/baseTrademark/update',data:trademark,method:'put'})
    else{
    //新增品牌
    return request({url:`/admin/product/baseTrademark/save`,data:trademark,method:'post'})
    }
}

//3.删除品牌接口
//DELETE /admin/product/baseTrademark/remove/{id}
export const reqdeletetradeMark=(id)=>{
    return request({url:`/admin/product/baseTrademark/remove/${id}`,method:'delete'})
}